import unittest

class Demo1TestCase(unittest.TestCase):
    def test1(self):
        print('1')

    def test2(self):
        print('2')


class Demo2TestCase(unittest.TestCase):
    def testa(self):
        print('a')

    def testb(self):
        print('b')

if __name__ == '__main__':
    # 创建测试套件对象
    suite = unittest.TestSuite()
    # TODO addTest单个添加，addTests添加多个，元组或者列表
    # 添加用例到套件对象里面
    suite.addTest(Demo1TestCase('test1'))
    suite.addTest(Demo2TestCase('testb'))
    # 创建执行器
    runner = unittest.TextTestRunner(verbosity=2)
    # 运行执行器
    runner.run(suite)